<%@ page contentType="text/html;charset=utf-8" %>
<%@ page language="java" import="java.io.*" %>
<%
	String docid = request.getParameter("docid");
	  try
	  {
		response.reset();
		response.setContentType("application/octet-stream");
		response.setHeader("Content-Disposition", "attachment; filename="+docid);
		java.io.InputStream in = new FileInputStream("D:/project/jwikidata/data/RejectedMessage-att/1234.doc-dir/"+docid+".doc");;
		//response.setContentLength(in.available());
		java.io.OutputStream outStream = response.getOutputStream();
		byte[] buf = new byte[1024];
		int bytes = 0;
		while((bytes = in.read(buf)) != -1)
			outStream.write(buf, 0, bytes);
		in.close();	
		outStream.close();	
	  }
	  catch(Throwable e)
	  {
	  	System.out.println(e.toString());
		throw new ServletException(e.toString());
	  }
%>